import PayManagement from "../pages/PayManagement"
import PayWays from "../pages/PayManagement/PayWays"
import PictureManagement from "../pages/PictureManagement"
import CarouselManagement from "../pages/PictureManagement/CarouselManagement"
import ProductManagement from "../pages/ProductManagement"
import ProductList from "../pages/ProductManagement/ProductList"
import ProductType from "../pages/ProductManagement/ProductType"
import TransactionManagement from "../pages/TransactionManagement"
import Amount from "../pages/TransactionManagement/Amount"
import Order from "../pages/TransactionManagement/Order"
import Refund from "../pages/TransactionManagement/Refund"
import Welcome from "../pages/Welcome"
import Login from "pages/Login"
import Page404 from "../pages/Page404"
//auth这个属性用于控制页面是否需要登入才能访问
const routes = [
    {
        path: "/404",
        component: Page404,
        auth: false
    },
    {
        path: "/",
        component: Welcome,
        auth: true,
        exact: true,
        meta: {
            name: "首页",
            icon:"icon-shouye"
        }
    },
    {
        path: "/login",
        component: Login,
        auth: false,
        exact: true,
        meta: {
            name: "登入"
        }
    },
    {
        path: "/product-management",
        component: ProductManagement,
        auth: true,
        exact: false,
        meta: {
            name: "商品管理",
            icon:'icon-shangpinguanli'
        },
        children: [
            {
                path: "/product-management/productlist",
                component: ProductList,
                auth: true,
                exact: true,
                meta: {
                    name: "商品列表",
                    icon:'icon-liebiao'
                }
            },
            {
                path: "/product-management/productType",
                component: ProductType,
                auth: true,
                exact: true,
                meta: {
                    name: "商品类目",
                    icon:'icon-tubiaozhizuomoban'
                }
            }
        ]
    },
    {
        path: "/transaction-management",
        component: TransactionManagement,
        auth: true,
        exact: false,
        meta: {
            name: "交易管理",
            icon:'icon-icon_A'
          
        },
        children: [
            {
                path: "/transaction-management/amount",
                component: Amount,
                auth: true,
                exact: true,
                meta: {
                    name: "交易金额",
                    icon:'icon-biaoqiankuozhan_jiaoyi-195'
                }
            },
            {
                path: "/transaction-management/order",
                component: Order,
                auth: true,
                exact: true,
                meta: {
                    name: "交易订单",
                    icon:"icon-cangpeitubiao_dingdan"
                }
            },
            {
                path: "/transaction-management/refund",
                component: Refund,
                auth: true,
                exact: true,
                meta: {
                    name: "退款管理",
                    icon:'icon-tuikuan'
                }
            }
        ]
    },
    {
        path: "/picture-management",
        component: PictureManagement,
        auth: true,
        exact: false,
        meta: {
            name: "图片管理",
            icon:"icon-tupian"
        },
        children: [
            {
                path: "/picture-management/carousel-management",
                component: CarouselManagement,
                auth: true,
                exact: true,
                meta: {
                    name: "轮播图管理",
                    icon:"icon-drxx70"
                }
            }
        ]
    },
    {
        path: "/pay-management",
        component: PayManagement,
        auth: true,
        exact: false,
        meta: {
            name: "支付管理",
            icon:"icon-zhifu"
        },
        children: [
            {
                path: "/pay-management/pay-ways",
                component: PayWays,
                auth: true,
                exact: true,
                meta: {
                    name: "支付方式",
                    icon:"icon-ziyuan"
                }
            }
        ]
    }
]
export default routes